import * as fs from "fs";
const firstPage = import.meta.env.VITE_APP_LOGIN_PAGE;

const routes = [
  {
    path: '/',
    redirect: firstPage,
    children: [
      {
        name: 'loginC',
        path: '/loginC',
        component: () => import('/@/views/loginC/index.vue'),
        meta: {
          title: '',
          keepAlive: false,
        },
      },
      {
        name: 'wxLogin',
        path: '/wxLogin',
        component: () => import('/@/views/login/wxLogin/index.vue'),
        meta: {
          title: '',
          keepAlive: false,
        },
      },
      {
        name: 'yhxy',
        path: '/yhxy',
        component: () => import('/@/views/loginC/component/index.vue'),
        meta: {
          title: '',
          keepAlive: false,
        },
      },
      {
        name: 'load',
        path: '/load',
        component: () => import('/@/views/load/index.vue'),
        meta: {
          title: '',
          keepAlive: false,
        },
      },
      {
        name: 'login',
        path: '/login',
        component: () => import('/@/views/login/index.vue'),
        meta: {
          title: '',
          keepAlive: false,
        },
      },
      {
        name: 'mainMenu',
        path: '/mainMenu',
        component: () => import('/@/views/mainMenu/index.vue'),
        meta: {
          title: '主页',
          keepAlive: true,
        },
      },
      {
        name: '学生考勤',
        path: '/xskq',
        component: () => import('/@/views/xskq/index.vue'),
        meta: {
          title: '学生考勤',
          keepAlive: true,
        },
      },
      {
        name: '学生课表',
        path: '/timeTable',
        component: () => import('/src/views/timeTable/index.vue'),
        meta: {
          title: '学生课表',
          keepAlive: false,
        },
      },
      {
        name: '学生选课',
        path: '/xsxk',
        component: () => import('/src/views/xsxk/index.vue'),
        meta: {
          title: '学生选课',
          keepAlive: true,
        },
      },

      {
        name: '学业情况',
        path: '/studWork',
        component: () => import('/src/views/studWork/index.vue'),
        meta: {
          title: '学业情况',
          keepAlive: true,
        },
      },
      {
        name: '学生评教',
        path: '/studentEvaluate',
        component: () => import('/src/views/studentEvaluate/index.vue'),
        meta: {
          title: '学生评教',
          keepAlive: false,
        }
      },
      {
        name: '个人信息',
        path: '/grxx',
        component: () => import('/src/views/grxx/index.vue'),
        meta: {
          title: '个人信息',
          keepAlive: true,
        },
      },
      {
        name: 'mainMenu_tea',
        path: '/mainMenu_tea',
        component: () => import('/@/views/mainMenu_tea/index.vue'),
        meta: {
          title: '主页',
          keepAlive: true,
        },
      },
      {
        name: '考勤记录',
        path: '/kqjl',
        component: () => import('/@/views/kqjl/index.vue'),
        meta: {
          title: '考勤记录',
          keepAlive: false,
        },
      },
      {
        name: '智慧教室',
        path: '/zhjs',
        component: () => import('/src/views/zhjs/index.vue'),
        meta: {
          title: '智慧教室',
          keepAlive: false,
        },
      },
      {
        name: '教学楼展示',
        path: '/show',
        component: () => import('/src/views/zhjs/components/show/showPage.vue'),
        meta: {
          // title: '修远楼A栋',
          // keepAlive: true,
        },
      },
      {
        name: '通知通告',
        path: '/notice',
        component: () => import('/src/views/zhjs/components/notice/index.vue'),
        meta: {
          title: '通知公告',
          keepAlive: false,
        },
      },
      {
        name: '通知公告',
        path: '/tzgg',
        component: () => import('/src/views/tzgg/index.vue'),
        meta: {
          title: '通知公告',
          keepAlive: false,
        },
      },
      {
        name: '教师点名',
        path: '/jsdm',
        component: () => import('/@/views/jsdm/index.vue'),
        meta: {
          title: '教师点名',
          // keepAlive: true,
        },
      },
      {
        name: '教学任务',
        path: '/TeachingTask',
        component: () => import('/@/views/TeachingTask/index.vue'),
        meta: {
          title: '教学任务',
          keepAlive: true,
        },
      },
      {
        name: '排课情况',
        path: '/pkqk',
        component: () => import('/@/views/pkqk/index.vue'),
        meta: {
          title: '排课情况',
          keepAlive: false,
        },
      },
      {
        name: '学生成绩',
        path: '/studGrade',
        component: () => import('/@/views/studGrade/index.vue'),
        meta: {
          title: '学生成绩',
          // keepAlive: true,
        },
      },
      {
        name: '考试安排',
        path: '/studentExamArrange',
        component: () => import('/src/views/examArrange/StudentIndex.vue'),
        meta: {
          title: '考试安排',
          keepAlive: false,
        },
      },
      {
        name: '监考任务',
        path: '/getTeacherExamArrange',
        component: () => import('/src/views/examArrange/TeacherIndex.vue'),
        meta: {
          title: '监考任务',
          keepAlive: false,
        },
      },
      {
        name: '监考查询',
        path: '/teacherExamArrangeQuery',
        component: () => import('/src/views/TeacherExamArrangeQuery/index.vue'),
        meta: {
          title: '监考查询',
          keepAlive: false,
        },
      },
      {
        name: '口令点名',
        path: '/kldm',
        component: () => import('/@/views/jsdm/component/dmfs/kldm/index.vue'),
        meta: {
          title: '口令点名',
          keepAlive: false,
        },
      },
      {
        name: '传统点名',
        path: '/ctdm',
        component: () => import('/@/views/jsdm/component/dmfs/ctdm/index.vue'),
        meta: {
          title: '传统点名',
          keepAlive: false,
        },
      },
      {
        name: '点名方式',
        path: '/dmfs',
        component: () => import('/@/views/jsdm/component/dmfs/index.vue'),
        meta: {
          title: '点名方式',
          keepAlive: false,
        },
      },
      {
        name: '点名详情',
        path: '/dmxq',
        component: () => import('/@/views/jsdm/component/dmxq/index.vue'),
        meta: {
          title: '点名详情',
          keepAlive: true,
        },
        beforeEnter: (to, from, next) => {
          if (to.query.id !== from.query.id) {
            to.meta.keepAlive = false;
          } else {
            to.meta.keepAlive = true;
          }
          next();
        },
        props: true,
      },

      {
        name: '公告详情',
        path: '/ggxq',
        component: () => import('/src/views/tzgg/component/ggxq/index.vue'),
        meta: {
          title: '公告详情',
          keepAlive: false,
        },
        props: true,
      },
      {
        name: 'ttsq',
        path: '/ttsq',
        component: () => import('/@/views/ttsq/index.vue'),
        meta: {
          title: '调停申请',
          keepAlive: false,
        },
      },
      {
        name: '添加申请',
        path: '/add',
        component: () => import('/@/views/ttsq/add/index.vue'),
        meta: {
          title: '添加申请',
          keepAlive: true,
        },
      },
      {
        name: 'stop',
        path: '/stop',
        component: () => import('/@/views/ttsq/stop/index.vue'),
        meta: {
          title: '停课申请',
          // keepAlive: true,
        },
      },
      {
        name: '详细信息',
        path: '/info',
        component: () => import('/@/views/ttsq/info/index.vue'),
        meta: {
          title: '详细信息',
          // keepAlive: true,
        },
      },
      {
        name: '填信息',
        path: '/fill',
        component: () => import('/@/views/ttsq/stop/fill/index.vue'),
        meta: {
          title: '填信息',
          // keepAlive: true,
        },
      },
      {
        name: '审批',
        path: '/ttsp',
        component: () => import('/@/views/ttsp/index.vue'),
        meta: {
          title: '审批',
          // keepAlive: true,
        },
      },
      {
        name: '申请详情',
        path: '/spInfo',
        component: () => import('/@/views/ttsp/spInfo/index.vue'),
        meta: {
          title: '申请详情',
          // keepAlive: true,
        },
      },
      {
        name: '听课管理',
        path: '/listenClass',
        component: () => import('/@/views/listenClass/index.vue'),
        meta: {
          title: '听课管理',
          // keepAlive: true,
        },
      },
      {
        name: '问卷调查',
        path: '/questionNaire',
        component: () => import('/@/views/questionNaire/index.vue'),
        meta: {title: '问卷调查'},
      },
      {
        name: '查看',
        path: '/view',
        component: () => import('/src/views/questionNaire/component/index.vue'),
        meta: {title: '查看',keepAlive: true},
      },
      {
        name: '选课',
        path: '/selectClass',
        component: () => import('/@/views/selectClass/index.vue'),
        meta: {title: '选课'},
      },
      {
        name: '查看课程',
        path: '/viewClass',
        component: () => import('/@/views/selectClass/component/index.vue'),
        meta: {title: '查看课程',keepAlive: true},
      },
      {
        name: '听课问卷',
        path: '/tkwj',
        component: () => import('/@/views/pkqk/tkwj/index.vue'),
        meta: {
          title: '听课问卷',
          // keepAlive: true,
        },
      },
      {
        name: '听课管理',
        path: '/listenClass',
        component: () => import('/@/views/listenClass/index.vue'),
        meta: {
          title: '听课管理',
          // keepAlive: true,
        },
      },
      {
        name: '问卷记录',
        path: '/wjjl',
        component: () => import('/@/views/listenClass/components/wjjl/index.vue'),
        meta: {
          title: '问卷记录',
          // keepAlive: true,
        },
      },
      {
        name: '问卷调查',
        path: '/questionNaire',
        component: () => import('/@/views/questionNaire/index.vue'),
        meta: {title: '问卷调查'},
      },
      {
        name: '查看',
        path: '/view',
        component: () => import('/src/views/questionNaire/component/index.vue'),
        meta: {title: '查看',keepAlive: true},
      },
      {
        name: '选课',
        path: '/selectClass',
        component: () => import('/@/views/selectClass/index.vue'),
        meta: {title: '选课'},
      },
      {
        name: '查看课程',
        path: '/viewClass',
        component: () => import('/@/views/selectClass/component/index.vue'),
        meta: {title: '查看课程',keepAlive: true},
      },
    ],
  },
];

export default routes;
